package com.zb.api;

import cn.hutool.json.JSONUtil;
import com.zb.ThreadPoolStatusMonitor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class TestThreadPoolApi {

    @Autowired
    private ThreadPoolStatusMonitor statusMonitor;

    @GetMapping
    public String getThreadPool() {
        Map<String, Object> demo = statusMonitor.getThreadPoolRuntimeStatus("demo");
        return JSONUtil.toJsonStr( demo);
    }
}
